<script setup>
import { ref } from 'vue';
const bBar = ref(false)
</script>
<template>
  <div>
    Child

    <button @click="bBar = !bBar">弹框</button>

    <!-- <Teleport to="body"> -->
    <Teleport to="#dialog">
      <div v-if="bBar" class="box">🤣</div>
    </Teleport>
  </div>
</template>



<style lang="scss" scoped>
.box {
  width: 100px;
  height: 100px;
  background-color: teal;
}
</style>